package com.patterns.abstractFortory.addSexFactory;

import com.patterns.abstractFortory.addSexFactory.humanFactory.HumanFactory;
import com.patterns.abstractFortory.addSexFactory.humanInterface.Human;
import com.patterns.abstractFortory.addSexFactory.workShop.FemaleFactory;
import com.patterns.abstractFortory.addSexFactory.workShop.MaleFactory;

/**
 * Created by Xiao Yiyun on 2017/4/18.
 * 测试类
 */
public class NvWaTest {
    public static void main(String[] args) {
        //男人生产车间
        HumanFactory male = new MaleFactory();
        //女人生产车间
        HumanFactory female = new FemaleFactory();

        //生产一个黄种女人
        Human femaleYellowHuman = female.createYelloHuman();
        System.out.println("————生产了一个黄种女人——————");
        femaleYellowHuman.getColor();
        femaleYellowHuman.talk();
        femaleYellowHuman.getSex();

        //生产一个黄种男人
        Human maleYellowHuman = male.createYelloHuman();
        System.out.println("------生产了一个黄种男人---------");
        maleYellowHuman.getColor();
        maleYellowHuman.talk();
        maleYellowHuman.getSex();
    }
}